<include file="Public:header" />
<include file="Public:mainNavBar" />
<include file="Public:sidebar" />

<script type="text/javascript" src="__APP__/Public/js/ajaxFileUpload.js"></script>


<div id="wrapper" class="wat-cf">
	<div id="main">
		<div id="block-text" class="block">
			<div class="content">
				<h2 class="title">{:L('import')}</h2>
				
				<div>
					<input type="file" id="aFile" name="aFile" onchange="importFile();"/>
				</div>
			</div>
		</div>
		<include file="Public:message" />
	</div>
</div>


<script>
function importFile() {
	$.ajaxFileUpload({
        url: '/Admin/Agency/doImport',
        secureuri: false,
        fileElementId: 'aFile',
        type:'json',
        success: function(data){
        	var obj = $.parseJSON(data);
        	if (obj.status == 1) {
        		showMessage(obj.msg,'notice');
        	} else if(obj.status == 0) {
        		showMessage(obj.msg, 'error');
        	}
        }
    });
}
</script>
<include file="Public:footer" />